﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using LPV_POS.Baocao;
using LPV_POS.Module;
using CrystalDecisions.CrystalReports.Engine;
using System.Resources;
using System.Globalization;

namespace LPV_POS.mh_baocao
{
    public partial class mh_inbaocao : DevExpress.XtraEditors.XtraForm
    {
        CultureInfo culture;
        public int loaibaocao = 0;
        #region "Muti language"

        private void SetLanguage_banhang(string cultureName)
        {
            try
            {
                culture = CultureInfo.CreateSpecificCulture(cultureName);
                ResourceManager rm = new ResourceManager("LPV_POS.Muti_language.MyResource", typeof(mh_inbaocao).Assembly);
                lbel_intatca.Text = rm.GetString("intatca", culture);
                lbel_indoanhthu.Text = rm.GetString("indoanhthu", culture);
                lbel_inhienhanh.Text = rm.GetString("inhienhanh", culture);
                lbelThoat.Text = rm.GetString("thoat", culture);
               
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Note");
            }

        }

        #endregion
        private void lickdown(object sender, MouseEventArgs e)
        {
            ((Label)sender).BackColor = Color.FromArgb(192, 249, 251);
            ((Label)sender).BorderStyle = BorderStyle.Fixed3D;
        }

        private void lickup(object sender, MouseEventArgs e)
        {
            ((Label)sender).BackColor = Color.FromArgb(144, 196, 255);
            ((Label)sender).BorderStyle = BorderStyle.FixedSingle;
        }
        public mh_inbaocao()
        {
            InitializeComponent();
        }
      

        private void lbel_baocaotatca_MouseDown(object sender, MouseEventArgs e)
        {
            lickdown(sender, e);
        }

        private void lbel_baocaotatca_MouseUp(object sender, MouseEventArgs e)
        {
            lickup(sender, e);
        }

        private void lbel_baocaotatca_Click(object sender, EventArgs e)
        {
            loaibaocao = 1;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void lbel_baocaodoanhthu_Click(object sender, EventArgs e)
        {
            loaibaocao = 2;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void lbel_baocaohienhanh_Click(object sender, EventArgs e)
        {
            loaibaocao = 3;
            this.DialogResult = DialogResult.OK;
            this.Close();
       
        }

        private void mh_inbaocao_Load(object sender, EventArgs e)
        {
            cpublic ocpublic = new cpublic();
            string str_lang = ocpublic.Registry_Get("mh_main_lang");
            if (str_lang == "")
                str_lang = "vi-VN";
            SetLanguage_banhang(str_lang);
        }

        private void lbelThoat_Click(object sender, EventArgs e)
        {
            Mod_messagebox mess = new Mod_messagebox();
            mess.messagebox_pos("Thông báo", "Bạn muốn thoát?", loaithongbao.yesno.GetHashCode());
            if (Variable.thongbao == true)
            {

                this.Close();
            }
        }
    }
}